package mine;

/**
 * Created by james on 16/1/28.
 */
@author(name="sodino",webSite="sodino.com")//以"key=value"的形式进行赋值。
public class GoodsBean {
    @unique
    public long id;
    public String name;
    public long time;
    public int price;
    public boolean isPaid;
    /** 测试用。 */
    public byte testByte;
    /** 测试用。 */
    public short testShort;
    public float cicle;
    public double testDouble;

    public String toString() {
        StringBuffer strBuffer = new StringBuffer();
        strBuffer.append("id[" + id + "]\n");
        strBuffer.append("name[" + name + "]\n");
        strBuffer.append("time[" + time + "]\n");
        strBuffer.append("price[" + price + "]\n");
        strBuffer.append("isPaid[" + isPaid + "]\n");
        strBuffer.append("cicle[" + cicle + "]\n");
        strBuffer.append("testByte[" + testByte + "]\n");
        strBuffer.append("testShort[" + testShort + "]\n");
        strBuffer.append("testDouble[" + testDouble + "]\n");
        return strBuffer.toString();
    }

    public static GoodsBean newInstance() {
        GoodsBean bean = new GoodsBean();
        bean.id = 123456789l;
        bean.name = "AutoSave";
        bean.time = 12345234252342l;
        bean.price = 1024;
        bean.isPaid = true;
        bean.cicle = 2.356f;
        bean.testByte = 8;
        bean.testShort = 128;
        bean.testDouble = 9856.2145d;
        return bean;
    }
}
